(function() {
	var actId;
	//添加停车场
	$J('body').on('click', '#addBtn', function() {
		window.location.href = window.baseUrl + window.pathUrl + "/0";
	});
	//添加室内图pic
	$J('body').on('click', '#addMapBtn', function() {
		window.location.href = window.baseUrl +"/pd/lot/0/lotmappage/"+$J("#parlotId").val() ;
	});
	
	$J('body').on('click', '#queryBtn', function() {
		$J("#pageNo").val(1);
		document.queryForm.submit();
	});
	$J('body').on(
			'dblclick',
			'.dbtr',
			function() {
				window.location.href = window.baseUrl + window.pathUrl + "/"
						+ $J(this).data('content');
			});
	$J('body').on('click', 'a[name="remove-content"]', function() {
		actId = $J(this).data('content');
	});
	$J('body').on('click', '#removeBtn', function() {
		removeObj();
	});


	var removeObj = function() {
		$J.ajax({
			type : 'delete',
			url : window.baseUrl + window.pathUrl + "/" + actId,
			dataType : 'json',
			async : true,
			cache : false,
			success : function(data) {
				if (data.status == false) {
					if (data.msg)
						$J("#msg").html(data.msg);
					return;
				}
				alert("操作成功！");
				location.reload();
			},
			error : function(data) {
				$J("#msg").html(data.msg);
			}
		});
	}
})();
